package com.lzs.bootsafety.business.logs.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lzs.bootsafety.business.logs.entity.SysExc;
import com.lzs.bootsafety.business.logs.entity.SysOperLogs;
import com.lzs.bootsafety.business.logs.mapper.SysOperLogsMapper;
import com.lzs.bootsafety.business.logs.service.SysOperLogsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * @author  zhanshi Liu
 * @date    2020/04/15
 * @website www.jhmsona.cn
 */
@Service
public class SysOperLogsServiceImpl implements SysOperLogsService {
    @Autowired
    private SysOperLogsMapper sysOperLogsMapper;
    @Override
    public int insertSelective(SysOperLogs sysOperLogs) {
        return sysOperLogsMapper.insertSelective(sysOperLogs);
    }

    @Override
    public SysOperLogs getByPrimaryKey(Long operId) {
        return sysOperLogsMapper.selectByPrimaryKey(operId);
    }

    @Override
    public PageInfo<SysOperLogs> selectOperList(SysOperLogs sysOperLogs) {
        Integer page = sysOperLogs.getPage();
        Integer limit = sysOperLogs.getLimit();
        PageHelper.startPage(page = page == null ? 1 : page,limit = limit == null ? 10 : limit);
        List<SysOperLogs> operList = sysOperLogsMapper.selectOperList(sysOperLogs);
        return new PageInfo<SysOperLogs>(operList);
    }
}
